package com.rockcent.mall.lib.domain;

import com.rockcent.common.domain.IDEntityMall;
import com.rockcent.mall.lib.domain.enumclass.GiftPacketProductType;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.math.BigDecimal;

/**
 * Created by DK on 16/10/8.
 * 礼包产品
 */
@Entity
@Table(name = "gift_packet_products")
@DynamicInsert
@DynamicUpdate
public class MerchantGiftPacketProduct extends IDEntityMall {

    @Column(columnDefinition = "bigint comment '产品ID'")
    private Long productId;
    @Column(columnDefinition = "bigint comment '供应商产品id 做关联礼包冗余字段'")
    private Long marketId;
    @Column(columnDefinition = "bigint comment '礼包ID'")
    private Long packetId;
    @Column(columnDefinition = "bigint comment '产品所属商家ID 做关联礼包冗余字段'")
    private Long merchantId;
    @Column(columnDefinition = "bigint comment '供应商ID'")
    private Long marketMerchantId;
    @Column(columnDefinition = "varchar(30) comment '礼包产品类型 MASTER(\"主产品\") COLLOCATION(\"搭配\")'")
    @Enumerated(EnumType.STRING)
    private GiftPacketProductType giftPacketProductType;
    @Column(columnDefinition = "DECIMAL(30,10) comment '礼包产品单价'")
    private BigDecimal packetPrice;
    @Column(columnDefinition = "bigint comment '使用数量'")
    private Long useNumber;

    public Long getProductId() {
        return productId;
    }

    public void setProductId(Long productId) {
        this.productId = productId;
    }

    public Long getPacketId() {
        return packetId;
    }

    public void setPacketId(Long packetId) {
        this.packetId = packetId;
    }

    public Long getMerchantId() {
        return merchantId;
    }

    public void setMerchantId(Long merchantId) {
        this.merchantId = merchantId;
    }

    public GiftPacketProductType getGiftPacketProductType() {
        return giftPacketProductType;
    }

    public void setGiftPacketProductType(GiftPacketProductType giftPacketProductType) {
        this.giftPacketProductType = giftPacketProductType;
    }

    public BigDecimal getPacketPrice() {
        return packetPrice;
    }

    public void setPacketPrice(BigDecimal packetPrice) {
        this.packetPrice = packetPrice;
    }

    public Long getUseNumber() {
        return useNumber;
    }

    public void setUseNumber(Long useNumber) {
        this.useNumber = useNumber;
    }

    public Long getMarketId() {
        return marketId;
    }

    public void setMarketId(Long marketId) {
        this.marketId = marketId;
    }

    public Long getMarketMerchantId() {
        return marketMerchantId;
    }

    public void setMarketMerchantId(Long marketMerchantId) {
        this.marketMerchantId = marketMerchantId;
    }

    @Override
    public String toString() {
        return "MerchantGiftPacketProduct{" +
                "productId=" + productId +
                ", id=" + id +
                ", marketId=" + marketId +
                ", dateCreated=" + dateCreated +
                ", packetId=" + packetId +
                ", merchantId=" + merchantId +
                ", lastUpdated=" + lastUpdated +
                ", marketMerchantId=" + marketMerchantId +
                ", isDelete=" + isDelete +
                ", version=" + version +
                ", giftPacketProductType=" + giftPacketProductType +
                ", packetPrice=" + packetPrice +
                ", useNumber=" + useNumber +
                '}';
    }
}
